<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>tpblog管理后台</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.4 -->
    <link href="/Public/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <!-- FontAwesome 4.3.0 -->
    <link href="/Public/bootstrap/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <!-- Ionicons 2.0.0 --
    <link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="/Public/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css"/>
    <!-- AdminLTE Skins. Choose a skin from the css/skins 
    	folder instead of downloading all of them to reduce the load. -->
    <link href="/Public/dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css"/>
    <!-- iCheck -->
    <link href="/Public/plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css"/>
    <!-- jQuery 2.1.4 -->
    <script src="/Public/plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <script src="/Public/js/global.js"></script>
    <script src="/Public/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/Public/plugins/layerjs/layer.js"></script><!-- 弹窗js 参考文档 http://layer.layui.com/-->
    <script src="/Public/Admin/js/common.js"></script>
    <script src="/Public/Admin/js/myAjax.js"></script>
    <script type="text/javascript">
        function delfunc(obj) {
            layer.confirm('确认删除？', {
                        btn: ['确定', '取消'] //按钮
                    }, function () {
                        $.ajax({
                            type: 'post',
                            url: $(obj).attr('data-url'),
                            data: {act: 'del', del_id: $(obj).attr('data-id')},
                            dataType: 'json',
                            success: function (data) {
                                if (data == 1) {
                                    layer.msg('操作成功', {icon: 1});
                                    $(obj).parent().parent().remove();
                                } else {
                                    layer.msg(data, {icon: 2, time: 2000});
                                }
                                layer.closeAll();
                            }
                        })
                    }, function (index) {
                        layer.close(index);
                        return false;// 取消
                    }
            );
        }

        //全选
        function selectAll(name, obj) {
            $('input[name*=' + name + ']').prop('checked', $(obj).checked);
        }

        function get_help(obj) {
            layer.open({
                type: 2,
                title: '帮助手册',
                shadeClose: true,
                shade: 0.3,
                area: ['90%', '90%'],
                content: $(obj).attr('data-url'),
            });
        }

        function delAll(obj, name) {
            var a = [];
            $('input[name*=' + name + ']').each(function (i, o) {
                if ($(o).is(':checked')) {
                    a.push($(o).val());
                }
            })
            if (a.length == 0) {
                layer.alert('请选择删除项', {icon: 2});
                return;
            }
            layer.confirm('确认删除？', {btn: ['确定', '取消']}, function () {
                        $.ajax({
                            type: 'get',
                            url: $(obj).attr('data-url'),
                            data: {act: 'del', del_id: a},
                            dataType: 'json',
                            success: function (data) {
                                if (data == 1) {
                                    layer.msg('操作成功', {icon: 1});
                                    $('input[name*=' + name + ']').each(function (i, o) {
                                        if ($(o).is(':checked')) {
                                            $(o).parent().parent().remove();
                                        }
                                    })
                                } else {
                                    layer.msg(data, {icon: 2, time: 2000});
                                }
                                layer.closeAll();
                            }
                        })
                    }, function (index) {
                        layer.close(index);
                        return false;// 取消
                    }
            );
        }
    </script>
</head>
<body style="background-color:#ecf0f5;">
 

<body>
    <section class="content">
        <div class="container-fluid">
            <div class="panel panel-default">
                <div class="pull-right">
                    <a href="javascript:history.go(-1)" class="btn btn-default glyphicon glyphicon-arrow-left"></a>
                </div>
                <!-- Default panel contents -->
                <div class="panel-heading">
                    <h3 class="panel-title glyphicon glyphicon-list"> 菜单列表</h3>
                </div>
                <div class="panel-body">
                    <ul class="nav nav-tabs" role="tablist">
                        <li role="presentation" class="active"><a href="#">菜单列表</a></li>
                    </ul>
                    <!--表单-->
                    <form action="javascript:void(0);" role="form" id="menu" onsubmit="menu_operate('/index.php/Manager','<?php echo ($info["id"]); ?>')">
                        <table class="table table-bordered table-hover">
                            <tr>
                                <td>父级分类：</td>
                                <td>
                                    <select class="form-control" name="parent_id" style="width:250px;">
                                        <option value="0">请选择--</option>
                                        <?php if(is_array($menu)): foreach($menu as $key=>$vo): if($info['parent_id'] == $vo['id']): ?><option value="<?php echo ($vo["id"]); ?>" selected="selected"><?php echo ($vo["html"]); echo ($vo["menu_name"]); ?></option>
                                                <?php else: ?>
                                                <option value="<?php echo ($vo["id"]); ?>"><?php echo ($vo["html"]); echo ($vo["menu_name"]); ?></option><?php endif; endforeach; endif; ?>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>菜单名称：</td>
                                <td><input type="text" name="menu_name"  class="form-control menu_tips_1" value="<?php echo ($info["menu_name"]); ?>" style="width:250px;"></td>
                            </tr>
                            <tr>
                                <td>链接地址：</td>
                                <td><input type="text" name="url" class="form-control menu_tips_2" value="<?php echo ($info["url"]); ?>"></td>
                            </tr>
                            <tr>
                                <td>排序：</td>
                                <td><input type="text" name="sort" class="form-control" value="<?php echo ($info["sort"]); ?>" style="width:250px;"></td>
                            </tr>
                        </table>
                        <div class="pull-right">
                            <!--<button type="submit" class="btn btn-primary">保存</button>-->
                            <input type="hidden" id="parent_id" value="<?php echo ($info["parent_id"]); ?>">
                            <input type="submit" id="sub" value="保存" class="btn btn-primary">
                        </div>
                    </form>
                </div>
            </div>

        </div>
    </section>
</body>
</html>
<script>

</script>